package com.ioc;

import com.ioc.dao.UserDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**

 *
 */
public class IOCTest01 {


    public static void main(String[] args) {
        //让Spring加载配置文件
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserDao userDao1 = (UserDao) ctx.getBean("userDao");
        UserDao userDao2 = (UserDao) ctx.getBean("userDao");
        System.out.println(userDao1.hashCode());
        System.out.println(userDao2.hashCode());
        System.out.println(userDao1.hashCode()==userDao2.hashCode());
    }



}
